﻿using System.Collections.Generic;
using Reign.Core.MathF32;

namespace Reign.Video
{
	public class TriangleNormalComponent
	{
		public Vector4[] Normals;

		public TriangleNormalComponent(Vector4 normal1, Vector4 normal2, Vector4 normal3)
		{
			Normals = new Vector4[3] {normal1, normal2, normal3};
		}
	}

	public class TriangleUVComponent
	{
		public Vector4[] UVs;

		public TriangleUVComponent(Vector4 uv1, Vector4 uv2, Vector4 uv3)
		{
			UVs = new Vector4[3] {uv1, uv2, uv3};
		}
	}

	public class SoftwareTriangle
	{
		public int Index;
		public SoftwareVertex[] Verticies;
		public SoftwareEdge[] Edges;

		public SoftwareTriangle(int index, SoftwareVertex vertex1, SoftwareVertex vertex2, SoftwareVertex vertex3)
		{
			Index = index;
			Verticies = new SoftwareVertex[3] {vertex1, vertex2, vertex3};
			vertex1.Triangles.Add(this);
			vertex2.Triangles.Add(this);
			vertex3.Triangles.Add(this);
			vertex1.TraingleIndex.Add(0);
			vertex2.TraingleIndex.Add(1);
			vertex3.TraingleIndex.Add(2);
		}
	}
}